<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Construct a new device</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="class.zmqdevice.html">ZMQDevice</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="zmqdevice.getidletimeout.html">ZMQDevice::getIdleTimeout</a></div>
 <div class="up"><a href="class.zmqdevice.html">ZMQDevice</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="zmqdevice.construct" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">ZMQDevice::__construct</h1>
  <p class="verinfo">(PECL zmq &gt;= 0.5.0)</p><p class="refpurpose"><span class="refname">ZMQDevice::__construct</span> &mdash; <span class="dc-title">Construct a new device</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-zmqdevice.construct-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>ZMQDevice::__construct</strong></span>
    ( <span class="methodparam"><span class="type"><a href="class.zmqsocket.html" class="type ZMQSocket">ZMQSocket</a></span> <code class="parameter">$frontend</code></span>
   , <span class="methodparam"><span class="type"><a href="class.zmqsocket.html" class="type ZMQSocket">ZMQSocket</a></span> <code class="parameter">$backend</code></span>
   [, <span class="methodparam"><span class="type"><a href="class.zmqsocket.html" class="type ZMQSocket">ZMQSocket</a></span> <code class="parameter">$listener</code></span>
  ] )</div>

  <p class="para rdfs-comment">
   &quot;ØMQ devices can do intermediation of addresses, services, queues, or any other abstraction you care to define above the message and socket layers.&quot; -- zguide
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-zmqdevice.construct-parameters">
  <h3 class="title">参数</h3>
  <dl>

   
    <dt>
<em><code class="parameter">frontend</code></em></dt>

    <dd>

     <p class="para">
      Frontend parameter for the devices. Usually where there messages
      are coming.
     </p>
    </dd>

   
   
    <dt>
<em><code class="parameter">backend</code></em></dt>

    <dd>

     <p class="para">
       Backend parameter for the devices. Usually where there messages
       going to.
     </p>
    </dd>

   
   
    <dt>
<em><code class="parameter">listener</code></em></dt>

    <dd>

     <p class="para">
       Listener socket, which receives a copy of all messages going both directions.
       The type of this socket should be SUB, PULL or DEALER.
     </p>
    </dd>

   
  </dl>

 </div>


 <div class="refsect1 returnvalues" id="refsect1-zmqdevice.construct-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Call to this method will prepare the device. Usually devices are very long
   running processes so running this method from interactive script is not recommended. This
   method throw ZMQDeviceException if the device cannot be started.
  </p>
 </div>



</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="class.zmqdevice.html">ZMQDevice</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="zmqdevice.getidletimeout.html">ZMQDevice::getIdleTimeout</a></div>
 <div class="up"><a href="class.zmqdevice.html">ZMQDevice</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
